package com.ymatou.iapi.reachpromotion.testcase;

import java.util.ArrayList;
import java.util.List;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.iapi.marketingmanage.parameter.CreateSellerPromotionBean;
import com.ymatou.iapi.reachpromotion.parameter.GetMultiProductPromotionPolicyResp;
import com.ymatou.iapi.reachpromotion.parameter.GetPromotionByProductIdsBean;
import com.ymatou.iapi.reachpromotion.parameter.GetPromotionProductByIdResp;
import com.ymatou.iapi.reachpromotion.parameter.Product;
import com.ymatou.iapi.reachpromotion.parameter.ProductPromotionPolicyDto;
import com.ymatou.iapi.reachpromotion.parameter.SellerProduct;
import com.ymatou.iapi.reachpromotion.service.GetPromotionByProductIdsCall;
import com.ymatou.iapi.reachpromotion.service.PromotionInfoVerify;
import com.ymatou.iapi.trading.operate.parameter.enums.PromotionTypeEnum;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.*;
import com.ymt.utils.tag.*;
import com.ymttest.business.service.JSellerPromotionCallService;
import com.ymttest.utils.EnvSetup;
import com.ymttest.utils.TestDataManager;
import com.ymttest.utils.YMTDateUtil;
import com.ymttest.utils.compare.AssertHelper;
/**
*根据买手商品Id集合获取商品是否有促销信息
*FreeMaker Template自动生成代码
*/
@TestSuite
public class Ts_GetPromotionByProductIds{
	private static GetPromotionByProductIdsBean getpromotionbyproductidsBean;
	private static GetPromotionByProductIdsCall getpromotionbyproductidsCall;
	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("根据买手商品Id集合获取商品是否有促销信息");
	}

	@Before
	public void caseUp() {
		getpromotionbyproductidsBean=new GetPromotionByProductIdsBean();
		getpromotionbyproductidsCall=new GetPromotionByProductIdsCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getpromotionbyproductidsCall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetPromotionByProductIds_001() {
		Logger.start(true,"根据买手商品Id集合获取商品是否有促销信息");
		try {
			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			SellerProduct sellerProduct = new SellerProduct();
			
			sellerProduct.setSellerId(sellerid);
			
			List<Product> productInfos = new ArrayList<>();
			
			for (String productId : createSellerPromotionBean.getPromotionInfo().getProductIds()) {
				Product product2 = new Product();
				product2.setProductId(productId);
				productInfos.add(product2);
			}
				
			sellerProduct.setProductInfos(productInfos);
			
			List<SellerProduct> sellerProductInfos = new ArrayList<>();
			
			sellerProductInfos.add(sellerProduct);
			
			getpromotionbyproductidsBean.setIsShowPromotionDetail(true);
			getpromotionbyproductidsBean.setSellerProductInfos(sellerProductInfos);
			
			getpromotionbyproductidsCall.setData(getpromotionbyproductidsBean);
			getpromotionbyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getpromotionbyproductidsCall.getCode(), "验证返回Code");
			GetMultiProductPromotionPolicyResp resp = getpromotionbyproductidsCall.getMultiProductPromotionPolicyResp();

			// 验证PromotionInfo
			List<String> productIds = createSellerPromotionBean.getPromotionInfo().getProductIds();
			for (ProductPromotionPolicyDto sellerProduct2 : resp.getProductsPromotion()) {
				
				Logger.verifyEquals(sellerid, sellerProduct2.getSellerId(), "验证返回SellerId");
				Logger.verifyEquals(true, sellerProduct2.isIsPromotionProduct(), "验证返回IsPromotionProduct");

				PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
				promotionInfoVerify.verifyPromotionPolicyInDB(sellerProduct2.getPromotionInfo());
				promotionInfoVerify.isStringInList(productIds,sellerProduct2.getProductId());
			}
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetPromotionByProductIds_002() {
		Logger.start(true,"根据买手商品Id集合获取商品是否有促销信息-活动已取消");
		try {
			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			SellerProduct sellerProduct = new SellerProduct();
			
			sellerProduct.setSellerId(sellerid);
			
			List<Product> productInfos = new ArrayList<>();
			
			for (String productId : createSellerPromotionBean.getPromotionInfo().getProductIds()) {
				Product product2 = new Product();
				product2.setProductId(productId);
				productInfos.add(product2);
			}
				
			sellerProduct.setProductInfos(productInfos);
			
			List<SellerProduct> sellerProductInfos = new ArrayList<>();
			
			sellerProductInfos.add(sellerProduct);
			
			getpromotionbyproductidsBean.setIsShowPromotionDetail(true);
			getpromotionbyproductidsBean.setSellerProductInfos(sellerProductInfos);
			
			getpromotionbyproductidsCall.setData(getpromotionbyproductidsBean);
			getpromotionbyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getpromotionbyproductidsCall.getCode(), "验证返回Code");
			GetMultiProductPromotionPolicyResp resp = getpromotionbyproductidsCall.getMultiProductPromotionPolicyResp();
			
			Logger.verifyEquals(0, resp.getProductsPromotion().size(), "验证返回ProductsPromotion条数为0");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetPromotionByProductIds_003() {
		Logger.start(true,"根据买手商品Id集合获取商品是否有促销信息-活动未开始");
		try {
			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.ReduceIfCountEnough);

			createSellerPromotionBean.getPromotionInfo().setPromotionBeginTime(YMTDateUtil.getBeforeOrNextDay(1, YMTDateUtil.YMDTHMS_STRING));
			createSellerPromotionBean.getPromotionInfo().setPromotionEndTime(YMTDateUtil.getBeforeOrNextDay(2, YMTDateUtil.YMDTHMS_STRING));
			
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);

			SellerProduct sellerProduct = new SellerProduct();
			
			sellerProduct.setSellerId(sellerid);
			
			List<Product> productInfos = new ArrayList<>();
			
			for (String productId : createSellerPromotionBean.getPromotionInfo().getProductIds()) {
				Product product2 = new Product();
				product2.setProductId(productId);
				productInfos.add(product2);
			}
				
			sellerProduct.setProductInfos(productInfos);
			
			List<SellerProduct> sellerProductInfos = new ArrayList<>();
			
			sellerProductInfos.add(sellerProduct);
			
			getpromotionbyproductidsBean.setIsShowPromotionDetail(true);
			getpromotionbyproductidsBean.setSellerProductInfos(sellerProductInfos);
			
			getpromotionbyproductidsCall.setData(getpromotionbyproductidsBean);
			getpromotionbyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getpromotionbyproductidsCall.getCode(), "验证返回Code");
			GetMultiProductPromotionPolicyResp resp = getpromotionbyproductidsCall.getMultiProductPromotionPolicyResp();
			
			Logger.verifyEquals(0, resp.getProductsPromotion().size(), "验证返回ProductsPromotion条数为0");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetPromotionByProductIds_004() {
		Logger.start(true,"根据买手商品Id集合获取商品是否有促销信息-不存在活动的商品不返回");
		try {
			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.ReduceIfCountEnough);

			List<String> productids = createSellerPromotionBean.getPromotionInfo().getProductIds();
			String removeProduct=productids.get(0);
			productids.remove(0);
			
			createSellerPromotionBean.getPromotionInfo().setProductIds(productids);
			
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);

			SellerProduct sellerProduct = new SellerProduct();
			
			sellerProduct.setSellerId(sellerid);
			
			List<Product> productInfos = new ArrayList<>();
			
			for (String productId : createSellerPromotionBean.getPromotionInfo().getProductIds()) {
				Product product2 = new Product();
				product2.setProductId(productId);
				productInfos.add(product2);
			}
			
			Product product2 = new Product();
			product2.setProductId(removeProduct);
			productInfos.add(product2);

			sellerProduct.setProductInfos(productInfos);
			
			List<SellerProduct> sellerProductInfos = new ArrayList<>();
			
			sellerProductInfos.add(sellerProduct);
			
			getpromotionbyproductidsBean.setIsShowPromotionDetail(true);
			getpromotionbyproductidsBean.setSellerProductInfos(sellerProductInfos);
			
			getpromotionbyproductidsCall.setData(getpromotionbyproductidsBean);
			getpromotionbyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getpromotionbyproductidsCall.getCode(), "验证返回Code");
			GetMultiProductPromotionPolicyResp resp = getpromotionbyproductidsCall.getMultiProductPromotionPolicyResp();

			// 验证PromotionInfo
			List<String> productIds = createSellerPromotionBean.getPromotionInfo().getProductIds();
			for (ProductPromotionPolicyDto sellerProduct2 : resp.getProductsPromotion()) {
				
				Logger.verifyEquals(sellerid, sellerProduct2.getSellerId(), "验证返回SellerId");
				Logger.verifyEquals(true, sellerProduct2.isIsPromotionProduct(), "验证返回IsPromotionProduct");

				PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
				promotionInfoVerify.verifyPromotionPolicyInDB(sellerProduct2.getPromotionInfo());
				
				Logger.verifyEquals(true, promotionInfoVerify.isStringInList(productIds,sellerProduct2.getProductId()), "验证返回IsPromotionProduct");

				Logger.verifyEquals(false, sellerProduct2.getProductId().equals(removeProduct), "验证返回删除的productId不会返回");

			}
			Logger.verifyEquals(3, resp.getProductsPromotion().size(), "验证返回ProductsPromotion条数为3");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	public void Tc_GetPromotionByProductIds_005() {
		Logger.start(true,"根据买手商品Id集合获取商品是否有促销信息-同个商品存在多场活动中,但是其他买手的活动商品不返回");
		try {
			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);

			int sellerid2 = Integer.valueOf(EnvSetup.getData("jCouponSellerId"));	
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid2);

			createSellerPromotionBean.setSellerId(sellerid2);
			int promotionId2 = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);

			SellerProduct sellerProduct = new SellerProduct();
			
			sellerProduct.setSellerId(sellerid);
			
			List<Product> productInfos = new ArrayList<>();
			
			for (String productId : createSellerPromotionBean.getPromotionInfo().getProductIds()) {
				Product product2 = new Product();
				product2.setProductId(productId);
				productInfos.add(product2);
			}
			
			sellerProduct.setProductInfos(productInfos);
			
			List<SellerProduct> sellerProductInfos = new ArrayList<>();
			
			sellerProductInfos.add(sellerProduct);
			
			getpromotionbyproductidsBean.setIsShowPromotionDetail(true);
			getpromotionbyproductidsBean.setSellerProductInfos(sellerProductInfos);
			
			getpromotionbyproductidsCall.setData(getpromotionbyproductidsBean);
			getpromotionbyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getpromotionbyproductidsCall.getCode(), "验证返回Code");
			GetMultiProductPromotionPolicyResp resp = getpromotionbyproductidsCall.getMultiProductPromotionPolicyResp();

			// 验证PromotionInfo
			List<String> productIds = createSellerPromotionBean.getPromotionInfo().getProductIds();
			for (ProductPromotionPolicyDto sellerProduct2 : resp.getProductsPromotion()) {
				
				Logger.verifyEquals(sellerid, sellerProduct2.getSellerId(), "验证返回SellerId");
				Logger.verifyEquals(true, sellerProduct2.isIsPromotionProduct(), "验证返回IsPromotionProduct");

				PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
				promotionInfoVerify.verifyPromotionPolicyInDB(sellerProduct2.getPromotionInfo());
				
				Logger.verifyEquals(true, promotionInfoVerify.isStringInList(productIds,sellerProduct2.getProductId()), "验证返回IsPromotionProduct");

			}
			Logger.verifyEquals(4, resp.getProductsPromotion().size(), "验证返回ProductsPromotion条数为3");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_GetPromotionByProductIds_006() {
		Logger.start(true,"根据买手商品Id集合获取商品是否有促销信息-SellerId空");
		try {
			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);
			
			SellerProduct sellerProduct = new SellerProduct();
			
//			sellerProduct.setSellerId(sellerid);
			
			List<Product> productInfos = new ArrayList<>();
			
			for (String productId : createSellerPromotionBean.getPromotionInfo().getProductIds()) {
				Product product2 = new Product();
				product2.setProductId(productId);
				productInfos.add(product2);
			}
				
			sellerProduct.setProductInfos(productInfos);
			
			List<SellerProduct> sellerProductInfos = new ArrayList<>();
			
			sellerProductInfos.add(sellerProduct);
			
			getpromotionbyproductidsBean.setIsShowPromotionDetail(true);
			getpromotionbyproductidsBean.setSellerProductInfos(sellerProductInfos);
			
			getpromotionbyproductidsCall.setData(getpromotionbyproductidsBean);
			getpromotionbyproductidsCall.callService();			
			
			Logger.verifyEquals("201", getpromotionbyproductidsCall.getCode(), "验证返回Code");
			Logger.verifyEquals("请求处理失败|sellerId is <= 0", getpromotionbyproductidsCall.getMsg(), "验证返回Code");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P3.class})
	@TestCase
	public void Tc_GetPromotionByProductIds_007() {
		Logger.start(true,"根据买手商品Id集合获取商品是否有促销信息-product空");
		try {
			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			SellerProduct sellerProduct = new SellerProduct();
			
			sellerProduct.setSellerId(sellerid);
			
			List<Product> productInfos = new ArrayList<>();
			
			sellerProduct.setProductInfos(productInfos);
			
			List<SellerProduct> sellerProductInfos = new ArrayList<>();
			
			sellerProductInfos.add(sellerProduct);
			
			getpromotionbyproductidsBean.setIsShowPromotionDetail(true);
			getpromotionbyproductidsBean.setSellerProductInfos(sellerProductInfos);
			
			getpromotionbyproductidsCall.setData(getpromotionbyproductidsBean);
			getpromotionbyproductidsCall.callService();			
			
			Logger.verifyEquals("201", getpromotionbyproductidsCall.getCode(), "验证返回Code");
			Logger.verifyEquals("请求处理失败|seller products  is empty, sellerId:"+sellerid, getpromotionbyproductidsCall.getMsg(), "验证返回Code");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P2.class})
	@TestCase
	public void Tc_GetPromotionByProductIds_008() {
		Logger.start(true,"根据买手商品Id集合获取商品是否有促销信息-Seller与productid不匹配");
		try {
			int sellerid = Integer.valueOf(EnvSetup.getData("couponSellerId"));			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			int promotionId = JSellerPromotionCallService.CreateSellerPromotion(createSellerPromotionBean);

			SellerProduct sellerProduct = new SellerProduct();
			
			sellerProduct.setSellerId(3383);
			
			List<Product> productInfos = new ArrayList<>();
			
			for (String productId : createSellerPromotionBean.getPromotionInfo().getProductIds()) {
				Product product2 = new Product();
				product2.setProductId(productId);
				productInfos.add(product2);
			}
				
			sellerProduct.setProductInfos(productInfos);
			
			List<SellerProduct> sellerProductInfos = new ArrayList<>();
			
			sellerProductInfos.add(sellerProduct);
			
			getpromotionbyproductidsBean.setIsShowPromotionDetail(true);
			getpromotionbyproductidsBean.setSellerProductInfos(sellerProductInfos);
			
			getpromotionbyproductidsCall.setData(getpromotionbyproductidsBean);
			getpromotionbyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getpromotionbyproductidsCall.getCode(), "验证返回Code");
			GetMultiProductPromotionPolicyResp resp = getpromotionbyproductidsCall.getMultiProductPromotionPolicyResp();
			
			Logger.verifyEquals(0, resp.getProductsPromotion().size(), "验证返回ProductsPromotion条数为0");
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	@Ignore
	public void Tc_GetPromotionByProductIds_009() {
		Logger.start(true,"根据买手商品Id集合获取商品是否有促销信息-新老接口对比");
		try {
			int sellerid = TestDataManager.getRandomIntNum(6);			
			JSellerPromotionCallService.CancelOrEndPromotion(sellerid);

			CreateSellerPromotionBean createSellerPromotionBean = JSellerPromotionCallService.initCreateSellerPromotionBeanForSpeicalProduct(sellerid, PromotionTypeEnum.ReduceIfCountEnough);
			int promotionId = JSellerPromotionCallService.CreateOldSellerPromotion(createSellerPromotionBean);
			
			Thread.sleep(1000);
			
			SellerProduct sellerProduct = new SellerProduct();
			
			sellerProduct.setSellerId(sellerid);
			
			List<Product> productInfos = new ArrayList<>();
			
			for (String productId : createSellerPromotionBean.getPromotionInfo().getProductIds()) {
				Product product2 = new Product();
				product2.setProductId(productId);
				productInfos.add(product2);
			}
				
			sellerProduct.setProductInfos(productInfos);
			
			List<SellerProduct> sellerProductInfos = new ArrayList<>();
			
			sellerProductInfos.add(sellerProduct);
			
			getpromotionbyproductidsBean.setIsShowPromotionDetail(true);
			getpromotionbyproductidsBean.setSellerProductInfos(sellerProductInfos);
			
			getpromotionbyproductidsCall.setData(getpromotionbyproductidsBean);
			getpromotionbyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getpromotionbyproductidsCall.getCode(), "验证返回Code");
			GetMultiProductPromotionPolicyResp resp = getpromotionbyproductidsCall.getMultiProductPromotionPolicyResp();

			// 验证PromotionInfo
			List<String> productIds = createSellerPromotionBean.getPromotionInfo().getProductIds();
			for (ProductPromotionPolicyDto sellerProduct2 : resp.getProductsPromotion()) {
				
				Logger.verifyEquals(sellerid, sellerProduct2.getSellerId(), "验证返回SellerId");
				Logger.verifyEquals(true, sellerProduct2.isIsPromotionProduct(), "验证返回IsPromotionProduct");

				PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
				promotionInfoVerify.verifyPromotionPolicyInDB(sellerProduct2.getPromotionInfo());
				promotionInfoVerify.isStringInList(productIds,sellerProduct2.getProductId());
			}
			
			String url = getpromotionbyproductidsCall.getUrl();
			url=url.replace("reachpromotion.iapi.ymatou.com", "sellerpromotion.api.ymatou.com");
		
			getpromotionbyproductidsCall.setUrl(url);			
			getpromotionbyproductidsCall.callService();	
			
			Logger.verifyEquals("200", getpromotionbyproductidsCall.getCode(), "验证返回Code");
			GetMultiProductPromotionPolicyResp resp2 = getpromotionbyproductidsCall.getMultiProductPromotionPolicyResp();

			// 验证PromotionInfo
			for (ProductPromotionPolicyDto sellerProduct2 : resp2.getProductsPromotion()) {
				
				Logger.verifyEquals(sellerid, sellerProduct2.getSellerId(), "验证返回SellerId");
				Logger.verifyEquals(true, sellerProduct2.isIsPromotionProduct(), "验证返回IsPromotionProduct");

				PromotionInfoVerify promotionInfoVerify = new PromotionInfoVerify();
				promotionInfoVerify.verifyPromotionPolicyInDB(sellerProduct2.getPromotionInfo());
				promotionInfoVerify.isStringInList(productIds,sellerProduct2.getProductId());
			}
			
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
	
	@Test
	@Category({P1.class})
	@TestCase
	@Ignore
	public void Tc_GetPromotionByProductIds_010() {
		Logger.start(true,"根据买手商品Id集合获取商品是否有促销信息-新老接口对比-stg");
		try {
			int sellerid = 3207973;			
			int promotionId = 16983;
			
			SellerProduct sellerProduct = new SellerProduct();
			
			sellerProduct.setSellerId(sellerid);
			
			List<Product> productInfos = new ArrayList<>();
			
			Product product1 = new Product();
			product1.setProductId("4a1c7bb7-195c-469c-a44f-8e3b45e8f3e8");
			productInfos.add(product1);

			Product product2 = new Product();
			product1.setProductId("bfac4426-6059-4806-8a63-8a8e09c598e1");
			productInfos.add(product2);

			Product product3 = new Product();
			product1.setProductId("c38c9b0a-0515-4f79-8603-e8a6b5e3e4ef");
			productInfos.add(product3);
				
			sellerProduct.setProductInfos(productInfos);
			
			List<SellerProduct> sellerProductInfos = new ArrayList<>();
			
			sellerProductInfos.add(sellerProduct);
			
			getpromotionbyproductidsBean.setIsShowPromotionDetail(true);
			getpromotionbyproductidsBean.setSellerProductInfos(sellerProductInfos);
			
			getpromotionbyproductidsCall.setData(getpromotionbyproductidsBean);
			getpromotionbyproductidsCall.callService();			
			
			Logger.verifyEquals("200", getpromotionbyproductidsCall.getCode(), "验证返回Code");
			GetMultiProductPromotionPolicyResp resp = getpromotionbyproductidsCall.getMultiProductPromotionPolicyResp();

			String url = getpromotionbyproductidsCall.getUrl();
			url=url.replace("reachpromotion.iapi.ymatou.com", "sellerpromotion.api.ymatou.com");
		
			getpromotionbyproductidsCall.setUrl(url);			
			getpromotionbyproductidsCall.callService();	
			
			Logger.verifyEquals("200", getpromotionbyproductidsCall.getCode(), "验证返回Code");
			GetMultiProductPromotionPolicyResp resp2 = getpromotionbyproductidsCall.getMultiProductPromotionPolicyResp();

			AssertHelper.assertResultEqual(resp.getProductsPromotion().get(0), resp2.getProductsPromotion().get(0), "GetPromotionByProductIds");

		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}